﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Castle.ActiveRecord;

namespace FileManager_Server.DataLayer.Repository
{
    public interface IRepository : IDisposable
    {
        void Add<T>(T entity) where T:ActiveRecordBase<T>;
        long Count<T>() where T : ActiveRecordBase<T>;
        long Count<T>(Expression<Func<T, bool>> expression) where T : ActiveRecordBase<T>;
        void Delete<T>(T entity) where T : ActiveRecordBase<T>;
        IList<T> GetAll<T>() where T : ActiveRecordBase<T>;
        IList<T> GetAll<T>(Expression<Func<T, bool>> expression) where T : ActiveRecordBase<T>;
        T GetSingle<T>(Expression<Func<T, bool>> expression) where T : ActiveRecordBase<T>;
        void Update<T>(T entity) where T : ActiveRecordBase<T>;
        void UpdateList<T>(List<T> entitys) where T : ActiveRecordBase<T>;
    }
}